package com.inkyi.assistant.app.component.rsyntax.action;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 代码折叠
 */
public class CodeFoldingAction implements ActionListener {
    private final RSyntaxTextArea textArea;

    public CodeFoldingAction(RSyntaxTextArea textArea) {
        this.textArea = textArea;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        textArea.setCodeFoldingEnabled(!textArea.isCodeFoldingEnabled());
    }
}
